{% extends "misago/threadslist/base.html" %}
{% load i18n misago_absoluteurl misago_shorthands misago_stringutils %}


{% block title %}
  {% if list_name %}
    {{ list_name }} | {{ category }} | {{ block.super }}
  {% else %}
    {{ category }} | {{ block.super }}
  {% endif %}
{% endblock title %}


{% block meta-description %}
  {% if category.description %}
    {{ category.description }}
  {% endif %}
{% endblock meta-description %}


{% block og-title %}{{ category }}{% endblock %}
{% block twitter-title %}{{ category }}{% endblock %}


{% block og-description %}
  {% if category.description %}
    {{ category.description }}
  {% endif %}
{% endblock og-description %}


{% block twitter-description %}
  {% if category.description %}
    {{ category.description }}
  {% endif %}
{% endblock twitter-description %}


{% block og-url %}{% absoluteurl request_path %}{% endblock %}
{% block twitter-url %}{% absoluteurl request_path %}{% endblock %}


{% block extra-css %}
  {% if category.css_class %}
    page-threads-{{ category.css_class }}
  {% endif %}
{% endblock extra-css %}


{% block page-header %}
<div class="page-header">
  <div class="container">
    <div class="row">
      <div class="{{ user.is_authenticated|yesno:'col-md-8,col-xs-12' }}">
        <div class="row">
          <div class="hidden-xs col-sm-2 col-lg-1">
            <a href="{{ category.parent.get_absolute_url }}{% if list_type != 'all' %}{{ list_type }}/{% endif %}" class="btn btn-default btn-icon btn-aligned btn-go-back btn-block btn-outline">
              <span class="material-icon">
                keyboard_arrow_left
              </span>
            </a>
          </div>
          <div class="col-xs-12 col-sm-10 col-lg-11 sm-align-row-buttons">
            <a href="{{ category.parent.get_absolute_url }}{% if list_type != 'all' %}{{ list_type }}/{% endif %}" class="go-back-sm visible-xs-block btn-outline">
              <span class="material-icon">
                chevron_left
              </span>
              {% if parent.parent %}{{ parent.name }}{% else %}{% trans "Threads" %}{% endif %}
            </a>
            <h1>{{ category }}</h1>
          </div>
        </div>
      </div>
    </div>
  </div>
  {% if user.is_authenticated %}
    {% include "misago/threadslist/tabs.html" %}
  {% endif %}
</div>
{% endblock page-header %}


{% block list-container %}
  {% if category.description %}
    <div class="category-description">
      <div class="page-lead {{ category.description|force_escape|linebreaks|isdescriptionshort|iftrue:"lead" }}">
        {{ category.description|force_escape|urlize|linebreaks|safe }}
      </div>
    </div>
  {% endif %}

  {{ block.super }}
{% endblock list-container%}